#define _CRT_SECURE_NO_WARNINGS 1

#include "shared_ptr.h"

class A
{
public:
	A()
	{
		;
	}

	~A()
	{
		cout << "~ A" << endl;
	}

	void operator()()
	{
		cout << "A()" << endl;
	}
};

int main()
{
	Auto_ptr::shared_ptr<A> pa1 = new A();
	Auto_ptr::shared_ptr<A> pa2 = new A();

	cout << pa1.use_count() << endl;
	cout << pa2.use_count() << endl;

	Auto_ptr::shared_ptr<A> pa3 = pa1;
	cout << pa3.use_count() << endl;

	pa2 = pa3;
	cout << pa2.use_count() << endl;

	function<void(A)> f1 = &A::operator();
	f1(A());

	return 0;
}